package com.cup.wx.micro.service;

import java.util.Map;

import com.cup.wx.micro.bean.AppletSession;
import com.cup.wx.micro.bean.WxAccessToken;
import com.cup.wx.micro.bean.WxUserInfo;

public interface WXBaseService {
	
	/**
	 * get wechat access token
	 * @return
	 */
	public void getRemoteAccessToken();
	
	/**
	 * get wechat access token
	 * @return
	 */
	public WxAccessToken getRedisAcessToken();
	
	/**
	 * get wechat Authorization access token
	 * 微信公众号网页授权
	 * @return
	 */
	public Map<String, Object> getAuthorizationAccessToken(String code) throws Exception;
	
	/**
	 * 微信公众号获取用户信息
	 * @param accesstoken authorization access token
	 * @return
	 */
	public WxUserInfo getWxUserInfo(String accesstoken, String openid);
	
	/**
	 * applet user login
	 * 小程序登录
	 * @return
	 */
	public AppletSession appletLogin(String appid, String secret, String code) throws Exception;
	
	/**
	 * get applet user info 
	 * 小程序解密用户信息
	 * @return
	 */
	public Map<String, Object> getAppletUserInfo(String appid, String encrypteddata, String sessionKey, String iv);
	
	/**
	 * get applet phone info
	 * 小程序解密绑定phone 
	 * @return
	 */
	public Map<String, Object> getAppletPhoneNum(String appid, String encrypteddata, String sessionKey, String iv);
	
}
